function liandonglist(){
	/**
 * @author wangxiaowei
 * 岗位查询
 */
var sort = null; 
var grid = null;
Ext.BLANK_IMAGE_URL=Ext.get('basePath').getValue()+"ajaxFramework/ext-2.1/resources/images/default/s.gif";	
	var colModel = new Ext.grid.ColumnModel([
		{header:'联动名称',dataIndex:'lianDongLable',menuDisabled : true},
		{header:'联动内容',dataIndex:'lianDongName',menuDisabled : true},	
		{header:'排序号',dataIndex:'sort',menuDisabled:true,width:20},
		{header:'操作',dataIndex:'operate',menuDisabled : true,renderer:function(s,m,rec){
			return "<a  href="+"javascript:updateToLianDong("+rec.data.id+")>修改</a>";
		}}
		
		
	]);
	var url = Ext.get('url').getValue();
	sort = new Ext.data.JsonStore({
		url:url,
		fields:['id','lianDongLable','lianDongName','operate','lianDongId','sort']
	
	});

	
    grid = new Ext.grid.GridPanel({
		title:'联动列表',
		cm:colModel,
		renderTo:'topic-grid',
		store:sort,
		loadMask:true,
		autoHeight:true,
		tbar:[{
			 text: '添加',
             iconCls: 'silk-add',
              handler:function(){
             	window.location.href=Ext.get('basePath').getValue()+'tjsinfo/tjsoa/system/addLianDongForm.do';
             }
		}],
		viewConfig:{
			forceFit:true,
			enableRowBody:true,
			getRowClass:function(record,rowIndex,p,ds){
				if(record.get('start') == '禁用')
				{
					return 'red-row';
				}
			}
		}
	});
	sort.load();	
}


function enablePost(id){
	 Ext.MessageBox.show({
          title:'消息',
          msg: '是否执行此操作?',
          buttons: Ext.MessageBox.YESNO,
          fn: function(btn){
          	  if(btn == 'yes'){
          	  	    var url = Ext.get('urlenable').getValue();
				Ext.Ajax.request({
					url:url,
					params:{
						id:id
					},
					success:function(response, options){
						    var responseArray = Ext.util.JSON.decode(response.responseText);                                              
		                     if(responseArray.success==true){
		                        Ext.Msg.alert('信息','操作成功！',function(){
		                        	sort.reload({callback :function(){
			                        		grid.getView().refresh();	
			                        	}});
		                        });     
		                     }
		                    else{
		                    	Ext.Msg.alert('信息','操作失败！');     
		                    } 
					}
				});
				
          	  }	
          },
          icon: Ext.MessageBox.QUESTION
      });		
}

function updateToLianDong(id){
	 window.location.href=Ext.get('basePath').getValue()+'tjsinfo/tjsoa/system/updateLianDongForm.do?id='+id;;	
}
	
